package rpc.log;

import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RpcLoggerFactory {

  private static final Map<String, Logger> loggerMap = new HashMap<>();

  public static Logger getLogger(String flowName) {
    Logger logger = loggerMap.getOrDefault(flowName, LoggerFactory.getLogger("server"));
    if (!loggerMap.containsKey(loggerMap)) {
      loggerMap.put(flowName, logger);
    }
    return logger;
  }
}
